package test5;

import java.io.FileReader;
import java.io.FileWriter;

public class test {
    public static void main(String[] args){
        FileReader fr=null;
        FileWriter fw=null;
        try {
            fr=new FileReader("e:\\a.txt");
            fw=new FileWriter("e:\\b.txt");
            char[] c=new char[1024];
            int n=0;
            while ((n=fr.read(c))!=-1){
                String s=new String(c,0,n);
                System.out.println(s);
                fw.write(s);
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                fr.close();
                fw.close();
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}
